<form id="questions-index-form" action="{:U('Questions/delete')}" method="post">

    <input type="hidden" name="questionnaire_id" value="{$questionnaire.id}">
    <input type="hidden" id="questionnaire_type" value="{$questionnaire.type}">

    <div class="questionnaire-info">
    	<div  class="questionnaire-title">
            <switch name="questionnaire.type">
                <case value="survey">
                    <span class="label label-danger"><i class="fa fa-tag"></i>调研卷</span>
                </case>
                <case value="exam">
                    <span class="label label-warning"><i class="fa fa-tag"></i>考试卷</span>
                </case>
            </switch> 

    		<h2>{$questionnaire.name}</h2>
    	</div>

    	<blockquote>
    	    <p>{$questionnaire.description}</p>
    	</blockquote>

        <a href="{:U('Signimage/index', array('questionnaire_id' => $questionnaire['id']))}">
            <div class="widget widget-warning widget-item-icon">
                <div class="widget-item-right">
                    <span class="fa fa-image"></span>
                </div>
                <div class="widget-data-left">
                    <div class="widget-int num-count">{$questionnaire.signimageNum}</div>
                    <div class="widget-title" style="font-family: '华文行楷'">已上传</div>
                    <div class="widget-subtitle" style="position: absolute;bottom: 0;font-family: '华文新魏'">管理问卷签名图</div>
                </div>
            </div>
        </a>

    </div>

    <div class="table-tools">
        <a href="{:U('Questions/add', array('questionnaire_id' => $questionnaire['id']))}" class="btn btn-info" title="添加新的问题"><i class="fa fa-copy"></i> 添 加 </a>
        <button type="submit" class="btn btn-primary" title="删除勾选的问题"><i class="glyphicon glyphicon-remove"></i> 删 除 </button>
        <button type="button" class="btn btn-success" title="重新排序问题" onclick="sortQuestions()"><i class="fa fa-copy"></i> 重 排 </button>
        <p>问题列表</p>
    </div>

    <table id="questions-table" class="table table-striped table-hover table-condensed datatable">
        <thead>
            <tr>
                <th width="50px"> </th>
                <th>问题</th>
                <th width="150px">操作</th>
                <th width="80px">排序</th>
            </tr>
        </thead>
        <tbody>
        	<volist name="questions" id="question">
        		<tr>
        			<td width="50px"><input name='id[]' type="checkbox" value="{$question.id}" /></td>
        			<td class="question-name">{$question.name}</td>
        			<td width="150px">
                        <a href="{:U('Questions/edit', array('id' => $question['id'], 'questionnaire_id' => $questionnaire['id']))}" class="btn btn-default btn-rounded btn-condensed btn-sm" title="编辑问题"><span class="fa fa-pencil"></span>
                        </a>
                        <a href="{:U('Questions/delete', array('id' => $question['id'], 'questionnaire_id' => $questionnaire['id']))}" class="btn btn-danger btn-rounded btn-condensed btn-sm" title="删除问题"><span class="fa fa-times"></span></a>
        			</td>
        			<td width="80px"><input name="sort[{$question.id}]" class="sort-input" type="text" value="{$question.sort}" /></td>
        		</tr>
        	</volist>
        </tbody>
    </table>
</form>